Page({
    data: {
      list: []
    },
  getList(trendsid) {
    var _this = this
    wx.showLoading({
      title: '评价加载中',
      mask: 'true'
    })
      var params = {
        trendsId: trendsid
      }
      wx.request({
        url: 'https://devapi.xiaoshitimebank.com/user/sdx/sdx/SdxCommons/findCommonsInfo/auth',
        data: params,
        method: 'POST',
        header: {
          "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
          "token": wx.getStorageSync('token'),
          "uid": wx.getStorageSync('uuid')
        },
        success: (res) => {
          if (res.data.code == 200) {
            wx.hideLoading()
            // var list = res.data.data

            for (var i = 0; i< res.data.data.length;i++) {
              res.data.data[i].commonsTIme = _this.formatDate(new Date(res.data.data[i].commonsTIme))
            }

            _this.setData({
              list: res.data.data
            })
          }else{
            wx.showToast({
              title: res.data.msg,
              icon: 'none'
            })
          }
        }
      })
    },


   formatDate(now) {
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var date = now.getDate();
    var hour = now.getHours();
    var minute = now.getMinutes();
    var second = now.getSeconds();
    return month + "月" + date + "日"
  },


    onLoad (options) {
      this.getList(options.trendsid)
    }
})
